<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件的基本使用</title>
</head>
<body>
    <div id="app">
        <cpn></cpn>
    </div>
</body>
<script src="../js/vue.js"></script>
<script>
    //1.创建组件构造对象
    const cpn = Vue.extend({
        template: `
            <div>
                <h2>标题</h2>
                <p>段落1</p>
                <p>段落2</p>
            </div>`,
    })

    const app = new Vue({
        el: '#app',
        data: {
            message: 'hello',
        },
        methods: {

        },
        components: {
            cpn
        }
    })
</script>
</html>